package cn.itcast.ssm.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtil {

    private static final String DATE_PATTERTN = "yyyy-MM-dd hh:mm:ss";

    public static String date2String(Date date){
        return date2String(date,DATE_PATTERTN);
    }

    public static String date2String(Date date, String pattern){
        return new SimpleDateFormat(pattern).format(date);
    }
}
